library(tidyverse)
library(DeclareDesign)
library(rdss)

sims <- 2000
p.values <- rep(NA, sims)

for(i in 1:sims){
  Z <- rbinom(100, 1, 0.5)
  U <- rnorm(100)
  Y <- 0.2 * Z + U
  p.values[i] <- summary(lm(Y ~ Z))$coefficients[2, 4]
}

diagnosis_10.1 <-
  tibble(power =  mean(p.values <= 0.05))

write_rds(diagnosis_10.1, 
          file = "diagnosis_objects/diagnosis_10.1.rds")